//===================================================================================
// $$
//
// Coder: Code Milker v1.0
// 0 - upper
// 1 - lower
//===================================================================================


namespace App.Domain.Handlers {
    using System;
    using App.Data;
    using App.Domain.Contracts;

    public class DeleteResume {
        private readonly IResumeRepository _ResumeRepository;

        public DeleteResume(IResumeRepository ResumeRepository) {
            _ResumeRepository = ResumeRepository;
        }

        public virtual void Execute(Guid resumeId) {
            var ResumeToDelete = _ResumeRepository.GetResume(resumeId);

            if (ResumeToDelete != null) {
                _ResumeRepository.Delete(resumeId);
            }
            else {
                throw new BusinessServicesException("UnableToDeleteVehicleExceptionMessage");
            }
        }
    }
}
